﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using liaowa2.Entity.DTO;
using liaowa2.Interface.Manager;
using liaowa2.Dao.Manager;
using liaowa2.Entity.InputDTO;
using liaowa2.Entity.Web;

namespace liaowa2.Impl.Manager
{
    public class ManagerUserImpl : IManagerUserInterface
    {

        public bool ChangPwd(string newPwd, string userCode)
        {
            return ManagerUserDao.ChangPwd(newPwd,userCode);
        }

        public bool CheckUserName(string userName)
        {
            return ManagerUserDao.CheckUserName(userName);
        }

        public int ManagerChangePwd(string userName, string oldPwd, string newPwd)
        {
            return ManagerUserDao.ManagerChangePwd(userName,oldPwd,newPwd);
        }

        public ResultMsg ManagerLogin(string UserName, string Password)
        {
            return ManagerUserDao.ManagerLogin(UserName,Password);
        }

        /// <summary>
        /// 根据条件获得数据列表
        /// </summary>
        public List<ManagerUser> GetList(string strWhere)
        {
            return ManagerUserDao.GetList(strWhere);
        }

        public EntityPage<ManagerUser> GetManagerUserPage(ManagerUserView input)
        { 
            return ManagerUserDao.GetManagerUserPage(input);
        }

        public bool IsEnable(int id, int enable)
        {
            return ManagerUserDao.IsEnable(id,enable);
        }

        public  async Task<ManagerUser> GetModel(int id = 0)
        {
            return await ManagerUserDao.GetModel(id);
        }

        public bool AddUser(ManagerUser input)
        {
            return ManagerUserDao.AddUser(input);
        }

        public bool EditUser(ManagerUser input)
        {
            return ManagerUserDao.EditUser(input);
        }

    }
}
